package io.polly.controller;

import io.polly.annotation.Permission;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ldz
 * @version V1.0
 * @title: MyController
 * @description: TODO(用一句话描述该文件做什么)
 * @date: 2022/3/23 17:13
 */
@RestController
public class MyController {

    @RequestMapping("/")
    public String helloWorld(){
        return "Hello World 呵呵";
    }

    @RequestMapping("/authn")
    @Permission(value ={"myRole1","myRole2"})
    public String helloAuthentication(){
        return "authN";
    }

    @RequestMapping("/authorization")
    @Permission
    public String helloAuthorization(){
        return "authZ";
    }
}
